package com.dayaokeji.rhythmschoolstudent.client.common.vote;

import android.content.Intent;
import android.os.Bundle;
import android.support.v4.app.FragmentTransaction;
import android.support.v7.widget.Toolbar;

import com.dayaokeji.rhythmschoolstudent.R;
import com.dayaokeji.rhythmschoolstudent.client.common.base.common.BaseActivity;

import butterknife.BindView;

/**
 * 投票
 */
public class VoteActivity extends BaseActivity {

    public static final String EXTRA_TEACHER_ID = "teacher_id";
    public static final String EXTRA_REL_ID = "rel_id";
    public static final String EXTRA_REL_TYPE = "rel_type";

    @BindView(R.id.toolbar)
    Toolbar toolbar;
    private int teacherId;
    private int relId;
    private int relType;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_vote);
        setSupportActionBar(toolbar);

        Intent intent = getIntent();
        teacherId = intent.getIntExtra(EXTRA_TEACHER_ID,-1);
        relId = intent.getIntExtra(EXTRA_REL_ID,-1);
        relType = intent.getIntExtra(EXTRA_REL_TYPE, -1);

        init();
    }

    private void init() {
        FragmentTransaction fragmentTransaction = getSupportFragmentManager().beginTransaction();
        fragmentTransaction.replace(R.id.content,VoteListFragment.newInstance(teacherId,relId,relType));
        fragmentTransaction.commit();
    }
}
